<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@taglib prefix="s" uri="/struts-tags" %>
<html>
  <head>
    <title>My JSP 'inquiry_productList.jsp' starting page</title>
   		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<META content="MSHTML 6.00.2900.5848" name=GENERATOR>
		<link href="../css/public.css" rel="stylesheet" style="text/css">
       <script type="text/javascript">
		function choseProduct(proId,proNum){
			var productId=document.getElementById(proId).value;
			var productNumber= document.getElementById(proNum).value;
			if(isNaN(productNumber)){
			 
			 alert("请输入正确的数量!");
			}
			else{
			location.href="inquiry_choseProduct.action?productId="+productId+"&prductNumber="+productNumber;
			}
		}
		function turnpage(){
		var number=document.getElementById("text").value;
		if(isNaN(number)){
		  window.location.href="inquiry_findCommodityAll.action?pb.pageon="+1;		
		}
		else{
		  window.location.href="inquiry_findCommodityAll.action?pb.pageon="+number;
		}
		
		}
		var theForm = document.forms['aspnetForm'];
		if (!theForm) {
		    theForm = document.aspnetForm;
		}
		function __doPostBack(eventTarget, eventArgument) {
		    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
		        theForm.__EVENTTARGET.value = eventTarget;
		        theForm.__EVENTARGUMENT.value = eventArgument;
		        theForm.submit();
		    }
		}
		function addlist(productId){
		  var curPage = document.getElementById("num"+productId).value; 
		  if(isNaN(curPage)){
		   location.href="ask_addlist?productid="+productId+"&num="+1; 		  
		  }
		  else{
		   location.href="ask_addlist?productid="+productId+"&num="+curPage; 
		  }
		}
	</script>
</HEAD>
	<BODY
		style="BACKGROUND-POSITION-Y: -120px; BACKGROUND-IMAGE: url(../images/background.gif); BACKGROUND-REPEAT: repeat-x">
	<label>
	</label>
<SCRIPT src="EmployeeMgr.files/WebResource.axd" type=text/javascript>
</SCRIPT>
<SCRIPT src="EmployeeMgr.files/ScriptResource.axd" type=text/javascript>
</SCRIPT>
<SCRIPT src="/EmployeeMgr.files/ScriptResource(1).axd" type=text/javascript>
</SCRIPT>
	<div id="layer4">
	  <form name="form1" method="post" action="inquiry_findCommodityAll.action">
	    <TABLE height="107%" cellSpacing=0 cellPadding=0 width="100%" border=0>
		<tbody>
            <TR
						style="BACKGROUND-IMAGE: url(../images/bg_header.gif); BACKGROUND-REPEAT: repeat-x"
						height=47>
              <TD width=15 height="47"><SPAN
								style="FLOAT: left; BACKGROUND-IMAGE: url(../images/main_hl.gif); WIDTH: 15px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px"> </SPAN> </TD>
              <TD width="1280"><SPAN
								style="FLOAT: left; BACKGROUND-IMAGE: url(../images/main_hl2.gif); WIDTH: 15px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px"> </SPAN> <SPAN
								style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FLOAT: left; BACKGROUND-IMAGE: url(../images/main_hb.gif); PADDING-BOTTOM: 10px; COLOR: white; PADDING-TOP: 10px; BACKGROUND-REPEAT: repeat-x; HEIGHT: 47px; TEXT-ALIGN: center; 0 px: "> <a href="ask_add.jsp">添加询价单</a> </SPAN><SPAN
								style="FLOAT: left; BACKGROUND-IMAGE: url(../images/main_hr.gif); WIDTH: 60px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px"></SPAN> </TD>
              <TD
							style="BACKGROUND-POSITION: 50% bottom; BACKGROUND-IMAGE: url(../images/main_rc.gif)"
							width=1></TD>
            </TR>
            <TR>
              <TD style="BACKGROUND-IMAGE: url(../images/main_ls.gif)">&nbsp;</TD>
              <TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; COLOR: #566984; PADDING-TOP: 10px; BACKGROUND-COLOR: white" vAlign=top align="left">
		<div>
               <table width="100%" border="0">
              <tr>
                <td width="3%">编号</td>
                <td width="17%"><label>
                  <input name="commodity.sn" type="text" value="${commodity.sn}" class="textbox">
                </label></td>
                <td width="7%">名称</td>
                <td width="17%" align="center"><input name="commodity.name" value="${commodity.name}" type="text" class="textbox"></td>
                <td width="7%">规格型号</td>
                <td width="18%"><input name="commodity.specifications" value="${commodity.specifications}" type="text" class="textbox"></td>
                <td width="6%">生产厂家</td>
                <td width="17%"><input name="commodity.factory" value="${commodity.factory}" type="text" class="textbox"></td>
                <td width="8%" align="center"><label>
                  <input name="Submit4" type="submit" class="buttonBlue" value="查询">
                </label></td>
              </tr>
            </table>
               <p class="STYLE1">所有商品列表</p>
               <s:form action="ask_choseProduct.action" method="post">
               <TABLE class=gridView11
									style="WIDTH: 100%;" cellSpacing=0
									 border=1 >
                <TR>
                  <TH width="50" class=gridViewHeader style="WIDTH: 50px" scope=col>&nbsp; </TH>
                  <TH width="131" class=gridViewHeader scope=col>商品编号</TH>
                  <TH width="239" class=gridViewHeader scope=col>商品名称</TH>
                  <TH width="230" class=gridViewHeader scope=col>规格型号</TH>
                  <TH width="65" class=gridViewHeader scope=col>单位</TH>
                  <TH width="198" class=gridViewHeader scope=col>生产厂家</TH>
                  <TH width="106" class=gridViewHeader scope=col>数量</TH>
                  <TH width="90" class=gridViewHeader scope=col>操作</TH>
                </TR>
                <s:iterator value="pb.list">  
                <input id="pro<s:property value='id'/>" type="hidden"  value="<s:property value='id'/>"/>                	
                   	<TR>
                     <TD class=gridViewItem style="WIDTH: 50px"><IMG src="EmployeeMgr.files/bg_users.gif"> </TD>
                     <TD class=gridViewItem>               
                     <s:property value="sn"/></TD>
                     <TD class=gridViewItem><s:property value="name"/></TD>
                     <TD class=gridViewItem><s:property value="specifications"/></TD>
                     <TD class=gridViewItem><s:property value="company"/></TD>
                     <TD class=gridViewItem><s:property value="prductNumber"/></TD>
                   	<TD class=gridViewItem><input type="text"  id="prom<s:property value='id'/>" size="10" /></TD>
                     <TD class=gridViewItem><label>
                       <input type="button" class="buttonBlue" value="加入" onClick="choseProduct('pro<s:property value='id'/>','prom<s:property value='id'/>')" >
                     </label></TD>
                   </TR>                            
                 </s:iterator>
                <tr>
                  <td colspan="9" align="right" class=gridViewHeader> 总共有${pb.totalitem}条记录 每页${pb.pagesize}条记录 当前为第${pb.pageon}页/ 总共有${pb.totalpage}页 
                  <a href="inquiry_findCommodityAll.action?pb.pageon=1">第一页</a> <a href="inquiry_findCommodityAll.action?pb.pageon=${pb.prep}">上一页</a> <a href="inquiry_findCommodityAll.action?pb.pageon=${pb.nextp}">下一页</a> <a href="inquiry_findCommodityAll.action?pb.pageon=${pb.totalpage}">最后一页</a> 转到第
                    <input  type="text" class="textbox" id="text"/>页
                    <input  type="submit" class=textbox onClick="javascript:turnpage()" value="Go"/>
                  </td>
                </tr>
				<tr>
				<td colspan="8">
				<p>&nbsp;</p>
				<p><span class="STYLE1">已加入商品列表</span>
				      <label>
				        <input type="button" name="Submit" value="添加完成" onClick="location.href='inquiry_add.action'">
				            </label>
				      </p></td>
			</tr>
			
                   <TR>
                     <TH width="50" class=gridViewHeader style="WIDTH: 50px" scope=col>&nbsp; </TH>
                     <TH width="131" class=gridViewHeader scope=col>商品编号</TH>
                     <TH width="239" class=gridViewHeader scope=col>商品名称</TH>
                     <TH width="230" class=gridViewHeader scope=col>规格型号</TH>
                     <TH width="65" class=gridViewHeader scope=col>单位</TH>
                     <TH width="198" class=gridViewHeader scope=col>数量</TH>
                     <TH class=gridViewHeader scope=col colspan="2">操作</TH>
                   </TR>
                   <s:iterator value="askInquirylist">
                   
                   	<TR>
                     <TD class=gridViewItem style="WIDTH: 50px"><IMG src="EmployeeMgr.files/bg_users.gif"> </TD>
                     <TD class=gridViewItem><s:property value="commodity.sn"/></TD>
                     <TD class=gridViewItem><s:property value="commodity.name"/></TD>
                     <TD class=gridViewItem><s:property value="commodity.specifications"/></TD>
                     <TD class=gridViewItem><s:property value="commodity.company"/></TD>
                     <TD class=gridViewItem><s:property value="number"/></TD>
                     <TD class=gridViewItem colspan="2"><label>
                       <input name="Submit42" type="button" class="buttonBlue" value="删除" onClick="location.href='inquiry_deleteProduct.action?productId=<s:property value="commodity.id"/>'">
                     </label></TD>
                   </TR>
                   </s:iterator>
        
            </TABLE>
           </s:form>
			   </div>
          </TD>
              <TD style="BACKGROUND-IMAGE: url(../images/main_rs.gif)"></TD>
            </TR>
            <TR
						style="BACKGROUND-IMAGE: url(../images/main_fs.gif); BACKGROUND-REPEAT: repeat-x"
						height=10>
              <TD style="BACKGROUND-IMAGE: url(../images/main_lf.gif)"></TD>
              <TD style="BACKGROUND-IMAGE: url(../images/main_fs.gif)"></TD>
              <TD style="BACKGROUND-IMAGE: url(../images/main_rf.gif)"></TD>
            </TR>
          </TBODY>
        </TABLE>
      </form>
    </DIV>					  
	</BODY>
</HTML>
